package com.showsu.editor.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: jph
 * @Description: 用户会员权益，次数项目
 * @Date: Created in 2:37 下午 2024/9/14
 * @Modified By:
 */
@Getter
@AllArgsConstructor
public enum DewaterTypeEnum {

    LIVE_DEWATER(UserPrivilegeEnum.XHSLIVE,2),
    DEWATER(UserPrivilegeEnum.PHOTOVIDEO,1),
    ANIM_IMG_DEWATER(UserPrivilegeEnum.GIFPHOTO,3),
    COMMENT_INFO_DEWATER(UserPrivilegeEnum.COMMENTPHOTO,4),
    COMMENTS_LIVE_DEWATER(UserPrivilegeEnum.XHSCOMMENTSLIVE,5),
    ;


    /**
     * 描述
     */
    final UserPrivilegeEnum up;

    /**
     * code
     */
    final Integer type;

    public static DewaterTypeEnum getByCode(UserPrivilegeEnum code){
        if (code == null) {
            return null;
        }
        for (DewaterTypeEnum iEnum : DewaterTypeEnum.values()) {
            if (iEnum.getUp().equals(code)) {
                return iEnum;
            }
        }
        return null;
    }


}
